#include "FrogFactory.h"

FrogFactory::FrogFactory(){
}

FrogFactory::~FrogFactory(void){
}

Element* FrogFactory::createElement( XMLElement* element) {
	return this->cretaeFrog(element);
}

Frog* FrogFactory::cretaeFrog(XMLElement* frogElement){
	
	Frog* frog = new Frog();
	
	string id = FactoryUtil::getInstance()->buildId(frogElement);
	Position *position = FactoryUtil::getInstance()->buildFrogPosition(frogElement);
	float radius = FactoryUtil::getInstance()->buildFrogRadius(frogElement);
	
	frog->setId(id);
	frog->setPosition(position);
	frog->setRadius(radius);
	frog->setElementColor(FactoryUtil::getInstance()->buildFrogBackgroundColor(frogElement));
	frog->setLineColor(FactoryUtil::getInstance()->buildFrogLineColor(frogElement));
	frog->setTexture(FactoryUtil::getInstance()->buildFrogTexture(frogElement));

	return frog;
}